<div class="col-md-9">
  <!-- random product -->
  <div class="span12">
	<div class="outer-border nav-page-sidebar-p10">
	  <div class="nav-judul bg-texture margin-bottom">
		<span class="judul-sidebar">
			<?php
				$absolute_url = full_url($_SERVER);
				$slug = str_replace("/BOS/kategori-","","$absolute_url");
				$sttmt = $koneksi->prepare("select * from kategori where slug_kategori = ?");
				$sttmt->execute(array($slug));
				$k = $sttmt->fetch(PDO::FETCH_ASSOC);
			?>
			Produk - <?php echo $k["kategori"]; ?>
		</span>
	  <div class="clearfix"></div>
	  </div>
	  <div class="row">
		<!-- 1 produk -->
		<?php
			$sttmt = $koneksi->query("select * from produk where id_kategori = $k[id_kategori]");
			while($hasil = $sttmt->fetch(PDO::FETCH_ASSOC)){
		?>
		<div class="col-md-4">
		  <div class="outer-noradius">
			<div class="kotak-produk">
			  <center>
				<img src="produk/<?php echo $hasil['gambar']; ?>">
			  </center>
			  <h1><?php echo $hasil['kode']; ?>
				  <br /> <?php echo $hasil['nama_produk'];?></h1>
			  <p class="harga">
				<?php 
					if($_SESSION['id_member'] != 'BOS000' && $hasil['diskon_member'] != 0){
						$harga = $hasil['harga'] * ((100 - $hasil['diskon_member'])/100);
						echo "<s>".harga($hasil['harga'])."</s> &nbsp; $harga"; 
					}else if($_SESSION['id_member'] == 'BOS000' && $hasil['diskon_umum'] != 0){
						$harga = $hasil['harga'] * ((100 - $hasil['diskon_member'])/100);
						echo "<s>".harga($hasil['harga'])."</s> &nbsp; $harga";
					}else{
						echo harga($hasil['harga']);
					} 
				?>
			  </p>
			  <p>
				<a href="<?php echo "produk-".$hasil["slug"]; ?>" class="btn btn-info btn-xs">
				  Detail
				</a>
				<?php
					$stok = $koneksi->query("select sum(stok) as jumlah from stok where id_produk = $hasil[id_produk]");
					$s = $stok->Fetch(PDO::FETCH_ASSOC);
					$jml = number_format($s['jumlah']);
					if($jml == 0){
					echo "<button type='button' class='btn btn-danger btn-xs'>
							Stok Habis									
						</button>";
					}
				?>
			  </p>
			</div>
		  <div class="clearfix"></div>
		  </div>
		<div class="clearfix"></div>
		</div>
		<!-- end 1 produk -->
		<?php
			}
		?>
	  </div>
	<div class="clearfix"></div>
	</div>
  <div class="clearfix"></div>
  </div>
  <!-- end random product -->

</div>